{% extends 'PHPDishWebBundle::layout.html.twig' %}

{% block title %}登录{% endblock %}

{% block script %}
<script type="text/javascript" src="{{ asset('build/js/sign.js') }}"></script>
{% endblock %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-sm-8 col-md-6 col-md-offset-3 col-sm-offset-2">
            <form class="reg-page" action="{{ path('fos_user_security_check') }}" method="post" id="login-form">
                <div class="reg-header">
                    <h2>登录你的账号</h2>
                    <p>还没有账户?点此<a href="{{ path('register') }}">注册</a></p>
                </div>
                {% if error %}
                <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
                {% endif %}
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-user"></i></span>
                        <input type="text" class="form-control" id="username" name="_username" placeholder="用户名或者邮箱" value="{{ last_username }}"/>
                    </div>
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-password"></i></span>
                        <input type="password" class="form-control" id="password" name="_password" placeholder="密码" value="{{ last_username }}"/>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 checkbox">
                        {#<label><input name="_remember_me" id="remember_me" type="checkbox" value="on">记住我</label>#}
                    </div>
                    <div class="col-md-6 text-right">
                        <a href="#" class="forgot-password">找回密码</a>
                    </div>
                </div>
                {% if csrf_token %}
                    <input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
                {% endif %}
                <button class="btn btn-md u-btn-primary btn-block" type="submit">登录</button>
                <div class="cross-line">
                    <span>或者使用</span>
                </div>
                <ul class="list-inline text-center social-connection">
                    <li class="list-inline-item ">
                        <a href="{{ hwi_oauth_login_url('github') }}" class="btn btn-sm u-btn-outline-black"><i class="if i-github"></i></a>
                    </li>
                    <li class="list-inline-item">
                        <a href="{{ hwi_oauth_login_url('qq') }}" class="btn btn-sm u-btn-outline-blue"><i class="if i-qq"></i></a>
                    </li>
                    <li class="list-inline-item">
                        <a href="{{ hwi_oauth_login_url('weibo') }}" class="btn btn-sm u-btn-outline-red"><i class="if i-weibo"></i></a>
                    </li>
                </ul>
            </form>
        </div>
    </div>
</div>
{% endblock %}